home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / test / src-uses.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1994-05-10  |  697 b   |  24 lines  |  [TEXT/R*ch]

  1. #!/bin/sh
  2.  
  3. # This script counts the references to GDL symbols in all Xconq sources.
  4.  
  5. cd ..
  6.  
  7. # Count uses of keywords.
  8.  
  9. for file in keyword.def action.def history.def plan.def task.def goal.def ; do
  10.     for sym in `grep '^DEF_' kernel/$file | sed -e 's/^[^,]*, \([a-zA-Z0-9_]*\)[,)].*$/\1/'` ; do
  11.         rslt=`grep -c ${sym} */*.[hc] | grep -v ':0$' | tr '\012' ' '`
  12.         echo ${sym} '    ' ${rslt}
  13.     done
  14. done
  15.  
  16. # Count uses of function-based symbols.
  17.  
  18. for file in utype.def mtype.def ttype.def table.def gvar.def ; do
  19.     for fun in `grep '^DEF_' kernel/${file} | sed -e 's/^[^,]*, \([a-zA-Z0-9_]*\),.*$/\1/'` ; do
  20.         rslt=`grep -c $fun */*.[hc] | grep -v ':0$' | tr '\012' ' '`
  21.         echo ${fun} '    ' ${rslt}
  22.     done
  23. done
  24.